﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EpubFactory.Template.Domain
{
    //public class Relator
    //{
    //    public string Code { get; private set; }
    //    public string Name { get; private set; }
    //    public Relator(string code, string name)
    //    {
    //        this.Code = code;
    //        this.Name = name;
    //    }
    //}
    public enum Relator
    {
        /// <summary>
        /// Use for a person or organization who principally exhibits acting skills in a musical or dramatic presentation or entertainment.
        /// </summary>
        Actor,
        /// <summary>
        /// Use for a person or organization who 1) reworks a musical composition, usually for a different medium, or 2) rewrites novels or stories for motion pictures or other audiovisual medium.
        /// </summary>
        Adapter,
        Analyst,
        Animator,
        Annotator,
        Applicant,
        Architect,
        Arranger,
        ArtCopyist,
        Artist,
        ArtisticDirector,
        Assignee,
        AssociatedName,
        AttributedName,
        Auctioneer,
        /// <summary>
        /// Use for a person or organization chiefly responsible for the intellectual or artistic content of a work, usually printed text. This term may also be used when more than one person or body bears such responsibility.
        /// </summary>
        Author,


    }
    public static class RelatorExtension
    {
        private static readonly string[] RELATOR_MAPPING = new string[] { "act", "adp", "anl", "anm", "ann", "app", "arc", "arr", "acp", "art", "ard", "asg", "asn", "att", "auc", "aut" };
        public static string Code(this Relator relator)
        {
            return RELATOR_MAPPING[(int)relator];
        }
    }
}
